

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SMARTD.CONF</TITLE>
</HEAD><BODY>
<H1>SMARTD.CONF</H1>
Section: SMART Monitoring Tools (5)<BR>Updated: 2015-06-04<BR><A HREF="#index">Index</A>
<A HREF=".">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

<B>smartd.conf</B> - SMART Disk Monitoring Daemon Configuration File
<P>
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>


[This man page is generated for the Windows version of smartmontools. It does not contain info specific to other platforms.] <P>


<B>/usr/local/etc/smartd.conf</B> is the configuration file for the <B>smartd</B>
daemon.
<P>
If the configuration file <B>/usr/local/etc/smartd.conf</B> is present,
<B>smartd</B> reads it at startup, before <B>fork</B>(2)ing into the
background. If <B>smartd</B> subsequently receives a <B>HUP</B> signal,
it will then re-read the configuration file.  If <B>smartd</B> is
running in debug mode, then an <B>INT</B> signal will also make it
re-read the configuration file. This signal can be generated by typing
<B>&lt;CONTROL-C&gt;</B> in the terminal window where <B>smartd</B> is
running.
<P>
In the absence of a configuration file
<B>smartd</B> will try to open all available devices
(see <B><A HREF="smartd.8.html">smartd</A></B>(8) man page).
A configuration file with a single line <B>'DEVICESCAN -a'</B>
would have the same effect.
<P>
This can be annoying if you have an ATA or SCSI device that hangs or
misbehaves when receiving SMART commands.  Even if this causes no
problems, you may be annoyed by the string of error log messages about devices
that can't be opened.
<P>
One can avoid this problem, and gain more control over the types of
events monitored by
<B>smartd</B>,
by using the configuration file
<B>/usr/local/etc/smartd.conf.</B>

This file contains a list of devices to monitor, with one device per
line.  An example file is included with the
<B>smartmontools</B>

distribution. You will find this sample configuration file in
<B>/usr/local/share/doc/smartmontools/</B>. For security, the configuration file
should not be writable by anyone but root. The syntax of the file is as
follows:
<DL COMPACT>
<DT>&bull;<DD>
There should be one device listed per line, although you may have
lines that are entirely comments or white space.
<DT>&bull;<DD>
Any text following a hash sign '#' and up to the end of the line is
taken to be a comment, and ignored.
<DT>&bull;<DD>
Lines may be continued by using a backslash '\' as the last
non-whitespace or non-comment item on a line.
<DT>&bull;<DD>
Note: a line whose first character is a hash sign '#' is treated as
a white-space blank line, <B>not</B> as a non-existent line, and will
<B>end</B> a continuation line.
</DL>
<P>

<P>
Here is an example configuration file.  It's for illustrative purposes
only; please don't copy it onto your system without reading to the end
of the
<B>DIRECTIVES</B>

Section below!
<P>
<PRE>
<B>################################################</B>
<B># This is an example smartd startup config file</B>
<B># /usr/local/etc/smartd.conf</B>
<B>#</B>
<B># On the second disk, start a long self-test every</B>
<B># Sunday between 3 and 4 am.</B>
<B>#</B>
<B>&nbsp;&nbsp;/dev/sda -a -m admin@example.com,root@localhost</B>
<B>&nbsp;&nbsp;/dev/sdb -a -I 194 -I 5 -i 12 -s L/../../7/03</B>
<B>#</B>
<B># Send a TEST warning email to admin on startup.</B>
<B>#</B>
<B>&nbsp;&nbsp;/dev/sdc -m admin@example.com -M test</B>
<B>#</B>
<B># Strange device.  It's SCSI. Start a scheduled</B>
<B># long self test between 5 and 6 am Monday/Thursday</B>
<B>&nbsp;&nbsp;/dev/weird -d scsi -s L/../../(1|4)/05</B>
<B>#</B>
<B># An ATA disk may appear as a SCSI device to the</B>
<B># OS. If a SCSI to ATA Translation (SAT) layer</B>
<B># is between the OS and the device then this can be</B>
<B># flagged with the '-d sat' option. This situation</B>
<B># may become common with SATA disks in SAS and FC</B>
<B># environments.</B>
<B>&nbsp;&nbsp;/dev/sda -a -d sat</B>
<B>#</B>
<B># Four ATA disks on a 3ware 6/7/8000 controller.</B>
<B># Start short self-tests daily between midnight and 1am,</B>
<B># 1-2, 2-3, and 3-4 am.  Starting with the Linux 2.6</B>
<B># kernel series, /dev/sdX is deprecated in favor of</B>
<B># /dev/tweN.  For example replace /dev/sdc by /dev/twe0</B>
<B># and /dev/sdd by /dev/twe1.</B>
<B>&nbsp;&nbsp;/dev/sdc -d 3ware,0 -a -s S/../.././00</B>
<B>&nbsp;&nbsp;/dev/sdc -d 3ware,1 -a -s S/../.././01</B>
<B>&nbsp;&nbsp;/dev/sdd -d 3ware,2 -a -s S/../.././02</B>
<B>&nbsp;&nbsp;/dev/sdd -d 3ware,3 -a -s S/../.././03</B>
<B>#</B>
<B># Two ATA disks on a 3ware 9000 controller.</B>
<B># Start long self-tests Sundays between midnight and</B>
<B># 1am and 2-3 am</B>
<B>&nbsp;&nbsp;/dev/twa0 -d 3ware,0 -a -s L/../../7/00</B>
<B>&nbsp;&nbsp;/dev/twa0 -d 3ware,1 -a -s L/../../7/02</B>
<B>#</B>
<B># Two SATA (not SAS) disks on a 3ware 9750 controller.</B>
<B># Start long self-tests Sundays between midnight and</B>
<B># 1am and 2-3 am</B>
<B>#</B>
<B># Three SATA disks on a HighPoint RocketRAID controller.</B>
<B># Start short self-tests daily between 1-2, 2-3, and</B>
<B># 3-4 am.</B>
<B>#</B>
<B># Two SATA disks connected to a HighPoint RocketRAID </B>
<B># via a pmport device.  Start long self-tests Sundays</B>
<B># between midnight and 1am and 2-3 am.</B>
<B># Three SATA disks connected to an Areca</B>
<B># RAID controller. Start long self-tests Sundays</B>
<B># between midnight and 3 am.</B>
<B>#</B>
<B># The following line enables monitoring of the </B>
<B># ATA Error Log and the Self-Test Error Log.  </B>
<B># It also tracks changes in both Prefailure</B>
<B># and Usage Attributes, apart from Attributes</B>
<B># 9, 194, and 231, and shows  continued lines:</B>
<B>#</B>
<B>&nbsp;&nbsp;/dev/sdd&nbsp;-l&nbsp;error&nbsp;\</B>
<B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-l&nbsp;selftest&nbsp;\</B>
<B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-t&nbsp;\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Attributes not tracked:</B>
<B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-I&nbsp;194&nbsp;\&nbsp;&nbsp;# temperature</B>
<B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-I&nbsp;231&nbsp;\&nbsp;&nbsp;# also temperature</B>
<B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-I 9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# power-on hours</B>
<B>#</B>
<B>################################################</B>
</PRE>

<P>
<A NAME="lbAD">&nbsp;</A>
<H2>CONFIGURATION FILE DIRECTIVES</H2>

If a non-comment entry in the configuration file is the text string
<B>DEVICESCAN</B>

in capital letters, then
<B>smartd</B>
will ignore any remaining lines in the configuration file, and will
scan for devices.
<B>DEVICESCAN</B>

may optionally be followed by Directives that will apply to all
devices that are found in the scan.  Please see below for additional
details.
<P>
If an entry in the configuration file starts with
<B>DEFAULT</B>

instead of a device name, then all directives in this entry are set
as defaults for the next device entries.
<P>

This configuration:
<P>

<PRE>
&nbsp;&nbsp;DEFAULT -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
&nbsp;&nbsp;/dev/sda
&nbsp;&nbsp;/dev/sdb
&nbsp;&nbsp;/dev/sdc
&nbsp;&nbsp;DEFAULT -H -m admin@example.com
&nbsp;&nbsp;/dev/sdd
&nbsp;&nbsp;/dev/sde -d removable
</PRE>

<P>

has the same effect as:
<P>

<PRE>
&nbsp;&nbsp;/dev/sda -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
&nbsp;&nbsp;/dev/sdb -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
&nbsp;&nbsp;/dev/sdc -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
&nbsp;&nbsp;/dev/sdd -H -m admin@example.com
&nbsp;&nbsp;/dev/sde -d removable -H -m admin@example.com
</PRE>

<P>
<P>
The following are the Directives that may appear following the device
name or
<B>DEVICESCAN</B>

or
<B>DEFAULT</B>

on any line of the
<B>/usr/local/etc/smartd.conf</B>

configuration file. Note that
<B>these are NOT command-line options for </B>

<B>smartd</B>.
The Directives below may appear in any order, following the device
name. 
<P>
<B>For an ATA device,</B>

if no Directives appear, then the device will be monitored
as if the '-a' Directive (monitor all SMART properties) had been given.
<P>
<B>If a SCSI disk is listed,</B>

it will be monitored at the maximum implemented level: roughly
equivalent to using the '-H -l selftest' options for an ATA disk.
So with the exception of '-d', '-m', '-l selftest', '-s', and
'-M', the Directives below are ignored for SCSI disks.  For SCSI
disks, the '-m' Directive sends a warning email if the SMART status
indicates a disk failure or problem, if the SCSI inquiry about disk
status fails, or if new errors appear in the self-test log.
<P>
<B>If a 3ware controller is used</B>

then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?,
/dev/twa?, /dev/twl? or /dev/tws?) must be listed, along with the '-d 3ware,N'
Directive (see below).  The individual ATA disks hosted by the 3ware
controller appear to <B>smartd</B> as normal ATA devices.  Hence all
the ATA directives can be used for these disks (but see note below).
<P>










<DL COMPACT>
<DT><B>-d TYPE</B>

<DD>
Specifies the type of the device.
The valid arguments to this directive are:
<P>
<I>auto</I>

- attempt to guess the device type from the device name or from
controller type info provided by the operating system or from
a matching USB ID entry in the drive database.
This is the default.
<P>
<I>ata</I>

- the device type is ATA.  This prevents
<B>smartd</B>
from issuing SCSI commands to an ATA device.
<P>

<I>scsi</I>

- the device type is SCSI.  This prevents
<B>smartd</B>
from issuing ATA commands to a SCSI device.
<P>
<I>sat[,auto][,N]</I>

- the device type is SCSI to ATA Translation (SAT).
This is for ATA disks that have a SCSI to ATA Translation (SAT) Layer
(SATL) between the disk and the operating system.
SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and
the other 16 bytes long.  The default is the 16 byte variant which can be
overridden with either '-d sat,12' or '-d sat,16'.
<P>
If '-d sat,auto' is specified, device type SAT (for ATA/SATA disks) is
only used if the SCSI INQUIRY data reports a SATL (VENDOR: &quot;ATA     &quot;).
Otherwise device type SCSI (for SCSI/SAS disks) is used.
<P>
<I>usbcypress</I>

- this device type is for ATA disks that are behind a Cypress USB to PATA
bridge.  This will use the ATACB proprietary scsi pass through command.
The default SCSI operation code is 0x24, but although it can be overridden
with '-d usbcypress,0xN', where N is the scsi operation code,
you're running the risk of damage to the device or filesystems on it.
<P>
<I>usbjmicron[,p][,x][,PORT]</I>

- this device type is for SATA disks that are behind a JMicron USB to
PATA/SATA bridge.  The 48-bit ATA commands (required e.g. for '-l xerror',
see below) do not work with all of these bridges and are therefore disabled by
default.  These commands can be enabled by '-d usbjmicron,x'.
If two disks are connected to a bridge with two ports, an error message is printed
if no PORT is specified.
The port can be specified by '-d usbjmicron[,x],PORT' where PORT is 0
(master) or 1 (slave).  This is not necessary if the device uses a port
multiplier to connect multiple disks to one port.  The disks appear under
separate /dev/ice names then.
CAUTION: Specifying ',x' for a device which does not support it results
in I/O errors and may disconnect the drive.  The same applies if the specified
PORT does not exist or is not connected to a disk.
<P>
The Prolific PL2507/3507 USB bridges with older firmware support a pass-through
command similar to JMicron and work with '-d usbjmicron,0'.
Newer Prolific firmware requires a modified command which can be selected by
'-d usbjmicron,p'.
Note that this does not yet support the SMART status command.
<P>
<I>usbprolific</I>

- [NEW EXPERIMENTAL SMARTD FEATURE]
this device type is for SATA disks that are behind a Prolific PL2571/2771/2773/2775
USB to SATA bridge.
<P>
<I>usbsunplus</I>

- this device type is for SATA disks that are behind a SunplusIT USB to SATA
bridge.
<P>



















<I>aacraid,H,L,ID</I>

- [Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTD FEATURE]
the device consists of one or more SCSI/SAS disks connected to an AacRaid controller.
The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk
on the controller is monitored.
In log files and email messages this disk will be identified as aacraid_disk_HH_LL_ID.
Please see the <B><A HREF="smartctl.8.html">smartctl</A></B>(8) man page for further details.
<P>


















<I>areca,N</I>

- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or more SATA disks
connected to an Areca SATA RAID controller.  The positive integer N (in the range
from 1 to 24 inclusive) denotes which disk on the controller is monitored.
In log files and email messages this disk will be identifed as
areca_disk_XX with XX in the range from 01 to 24 inclusive.
Please see the <B><A HREF="smartctl.8.html">smartctl</A></B>(8) man page for further details.
<P>
<I>areca,N/E</I>

- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one
or more SATA or SAS disks connected to an Areca SAS RAID controller.
The integer N (range 1 to 128) denotes the channel (slot) and E (range
1 to 8) denotes the enclosure.
Important: This requires Areca SAS controller firmware version 1.51 or later.
<P>
























<I>ignore</I>

- the device specified by this configuration entry should be ignored.
This allows to ignore specific devices which are detected by a following
DEVICESCAN configuration line.
It may also be used to temporary disable longer multi-line configuration entries.
This Directive may be used in conjunction with the other '-d' Directives.
<P>
<I>removable</I>

- the device or its media is removable.  This indicates to
<B>smartd</B>
that it should continue (instead of exiting, which is the default
behavior) if the device does not appear to be present when
<B>smartd</B> is started.  This Directive may be used in conjunction
with the other '-d' Directives.
<DT><B>-n POWERMODE[,N][,q]</B>

<DD>
[ATA only] This 'nocheck' Directive is used to prevent a disk from
being spun-up when it is periodically polled by <B>smartd</B>.
<P>
ATA disks have five different power states. In order of increasing
power consumption they are: 'OFF', 'SLEEP', 'STANDBY', 'IDLE',
and 'ACTIVE'.  Typically in the OFF, SLEEP, and STANDBY modes the
disk's platters are not spinning. But usually, in response to SMART
commands issued by <B>smartd</B>, the disk platters are spun up.  So if
this option is not used, then a disk which is in a low-power mode may
be spun up and put into a higher-power mode when it is periodically
polled by <B>smartd</B>.
<P>
Note that if the disk is in SLEEP mode when <B>smartd</B> is started,
then it won't respond to <B>smartd</B> commands, and so the disk won't
be registered as a device for <B>smartd</B> to monitor. If a disk is in
any other low-power mode, then the commands issued by <B>smartd</B> to
register the disk will probably cause it to spin-up.
<P>
The '<B>-n</B>' (nocheck) Directive specifies if <B>smartd</B>'s
periodic checks should still be carried out when the device is in a
low-power mode.  It may be used to prevent a disk from being spun-up
by periodic <B>smartd</B> polling.  The allowed values of POWERMODE
are:
<P>
<I>never</I>

- <B>smartd</B> will poll (check) the device regardless of its power
mode. This may cause a disk which is spun-down to be spun-up when
<B>smartd</B> checks it.  This is the default behavior if the '-n'
Directive is not given.
<P>
<I>sleep</I>

- check the device unless it is in SLEEP mode.
<P>
<I>standby</I>

- check the device unless it is in SLEEP or STANDBY mode.  In
these modes most disks are not spinning, so if you want to prevent
a laptop disk from spinning up each time that <B>smartd</B> polls,
this is probably what you want.
<P>
<I>idle</I>

- check the device unless it is in SLEEP, STANDBY or IDLE mode.
In the IDLE state, most disks are still spinning, so this is probably
not what you want.
<P>
Maximum number of skipped checks (in a row) can be specified by
appending positive number ',N' to POWERMODE (like '-n standby,15').
After N checks are skipped in a row, powermode is ignored and the
check is performed anyway.
<P>
When a periodic test is skipped, <B>smartd</B> normally writes an
informal log message. The message can be suppressed by appending
the option ',q' to POWERMODE (like '-n standby,q').
This prevents a laptop disk from spinning up due to this message.
<P>
Both ',N' and ',q' can be specified together.
<DT><B>-T TYPE</B>

<DD>
Specifies how tolerant
<B>smartd</B>
should be of SMART command failures.  The valid arguments to this
Directive are:
<P>
<I>normal</I>

- do not try to monitor the disk if a mandatory SMART command fails, but
continue if an optional SMART command fails.  This is the default.
<P>
<I>permissive</I>

- try to monitor the disk even if it appears to lack SMART
capabilities.  This may be required for some old disks (prior to
ATA-3 revision 4) that implemented SMART before the SMART standards
were incorporated into the ATA/ATAPI Specifications.
[Please see the <B>smartctl -T</B> command-line option.]
<DT><B>-o VALUE</B>

<DD>
[ATA only] Enables or disables SMART Automatic Offline Testing when
<B>smartd</B>
starts up and has no further effect.  The valid arguments to this
Directive are <I>on</I> and <I>off</I>.
<P>
The delay between tests is vendor-specific, but is typically four
hours.
<P>
Note that SMART Automatic Offline Testing is <B>not</B> part of the ATA
Specification.  Please see the
<B>smartctl -o</B>

command-line option documentation for further information about this
feature.
<DT><B>-S VALUE</B>

<DD>
Enables or disables Attribute Autosave when <B>smartd</B>
starts up and has no further effect.  The valid arguments to this
Directive are <I>on</I> and <I>off</I>.  Also affects SCSI devices.
[Please see the <B>smartctl -S</B> command-line option.]
<DT><B>-H</B>

<DD>
[ATA only] Check the health status of the disk with the SMART RETURN
STATUS command.
If this command reports a failing health status, then disk
failure is predicted in less than 24 hours, and a message at loglevel
<B>'LOG_CRIT'</B>

will be logged to syslog.  [Please see the
<B>smartctl -H</B>

command-line option.]
<DT><B>-l TYPE</B>

<DD>
Reports increases in the number of errors in one of three SMART logs.  The
valid arguments to this Directive are:
<P>
<I>error</I>

- [ATA only] report if the number of ATA errors reported in the Summary SMART
error log has increased since the last check.
<P>
<I>xerror</I>

- [ATA only] report if the number of ATA errors reported in the Extended
Comprehensive SMART error log has increased since the last check.
<P>
If both '-l error' and '-l xerror' are specified, smartd checks
the maximum of both values.
<P>
[Please see the <B>smartctl -l xerror</B> command-line option.]
<P>
<I>selftest</I>

- report if the number of failed tests reported in the SMART
Self-Test Log has increased since the last check, or if the timestamp
associated with the most recent failed test has increased.  Note that
such errors will <B>only</B> be logged if you run self-tests on the
disk (and it fails a test!).  Self-Tests can be run automatically by
<B>smartd</B>: please see the <B>'-s'</B> Directive below.
Self-Tests can also be run manually by using the <B>'-t&nbsp;short'</B>
and <B>'-t&nbsp;long'</B> options of <B>smartctl</B> and the results of
the testing can be observed using the <B>smartctl '-l&nbsp;selftest'</B>
command-line option.
[Please see the <B>smartctl -l</B> and <B>-t</B> command-line
options.]
<P>
[ATA only] Failed self-tests outdated by a newer successful extended
self-test are ignored.  The warning email counter is reset if the
number of failed self tests dropped to 0.  This typically happens when
an extended self-test is run after all bad sectors have been reallocated.
<P>
<I>offlinests[,ns]</I>

- [ATA only] report if the Offline Data Collection status has changed
since the last check.  The report will be logged as LOG_CRIT if the new
status indicates an error.  With some drives the status often changes,
therefore '-l offlinests' is not enabled by '-a' Directive.





<P>
[Windows and Cygwin only] If ',ns' (no standby) is appended to this
directive, smartd disables system auto standby as long as an Offline
Data Collection is in progress. See '-l selfteststs,ns' below.

<P>
<I>selfteststs[,ns]</I>

- [ATA only] report if the Self-Test execution status has changed
since the last check.  The report will be logged as LOG_CRIT if the new
status indicates an error.





<P>
[Windows and Cygwin only] If ',ns' (no standby) is appended to this
directive, smartd disables system auto standby as long as a Self-Test
is in progress.  This prevents that a Self-Test is aborted because the
OS sets the system to a standby/sleep mode when idle.  Smartd check
interval ('-i' option) should be shorter than the configured idle
timeout.  Auto standby is not disabled if the system is running on
battery.

<P>
<I>scterc,READTIME,WRITETIME</I>

- [ATA only] sets the SCT Error Recovery Control settings to the specified
values (deciseconds) when <B>smartd</B> starts up and has no further effect.
Values of 0 disable the feature, other values less than 65 are probably
not supported.  For RAID configurations, this is typically set to
70,70 deciseconds.
[Please see the <B>smartctl -l scterc</B> command-line option.]
<DT><B>-e NAME[,VALUE]</B>

<DD>
Sets non-SMART device settings when <B>smartd</B> starts up and has no
further effect.
[Please see the <B>smartctl --set</B> command-line option.]
Valid arguments are:
<P>
<I>aam,[N|off]</I>

- [ATA only] Sets the Automatic Acoustic Management (AAM) feature.
<P>
<I>apm,[N|off]</I>

- [ATA only] Sets the Advanced Power Management (APM) feature.
<P>
<I>lookahead,[on|off]</I>

- [ATA only] Sets the read look-ahead feature.
<P>
<I>security-freeze</I>

- [ATA only] Sets ATA Security feature to frozen mode.
<P>
<I>standby,[N|off]</I>

- [ATA only] Sets the standby (spindown) timer and places the drive in the
IDLE mode.
<P>
<I>wcache,[on|off]</I>

- [ATA only] Sets the volatile write cache feature.
<DT><B>-s REGEXP</B>

<DD>
Run Self-Tests or Offline Immediate Tests, at scheduled times.  A
Self- or Offline Immediate Test will be run at the end of periodic
device polling, if all 12 characters of the string <B>T/MM/DD/d/HH</B>
match the extended regular expression <B>REGEXP</B>. Here:
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT><B>T</B><DD>
is the type of the test.  The values that <B>smartd</B> will try to
match (in turn) are: 'L' for a <B>L</B>ong Self-Test, 'S' for a
<B>S</B>hort Self-Test, 'C' for a <B>C</B>onveyance Self-Test (ATA
only), and 'O' for an <B>O</B>ffline Immediate Test (ATA only).  As
soon as a match is found, the test will be started and no additional
matches will be sought for that device and that polling cycle.
<P>
To run scheduled Selective Self-Tests, use 'n' for <B>n</B>ext span,
'r' to <B>r</B>edo last span, or 'c' to <B>c</B>ontinue with next span
or redo last span based on status of last test.
The LBA range is based on the first span from the last test.
See the <B>smartctl -t select,[next|redo|cont]</B> options for
further info.
<P>
Some disks (e.g. WD) do not preserve the selective self test log accross
power cycles.  If state persistence ('-s' option) is enabled, the last
test span is preserved by smartd and used if (and only if) the selective
self test log is empty.
<DT><B>MM</B><DD>
is the month of the year, expressed with two decimal digits.  The
range is from 01 (January) to 12 (December) inclusive.  Do <B>not</B>
use a single decimal digit or the match will always fail!
<DT><B>DD</B><DD>
is the day of the month, expressed with two decimal digits. The
range is from 01 to 31 inclusive.  Do <B>not</B>
use a single decimal digit or the match will always fail!
<DT><B>d</B><DD>
is the day of the week, expressed with one decimal digit.  The
range is from 1 (Monday) to 7 (Sunday) inclusive.
<DT><B>HH</B><DD>
is the hour of the day, written with two decimal digits, and given in
hours after midnight.  The range is 00 (midnight to just before 1am)
to 23 (11pm to just before midnight) inclusive.  Do <B>not</B> use a
single decimal digit or the match will always fail!
</DL>
</DL>



<DT><B></B>

<DD>
Some examples follow.  In reading these, keep in mind that in extended
regular expressions a dot <B>'.'</B> matches any single character, and
a parenthetical expression such as <B>'(A|B|C)'</B> denotes any one of the three possibilities <B>A</B>,
<B>B</B>, or <B>C</B>.
<P>
To schedule a short Self-Test between 2-3am every morning, use:
<PRE>
<B> -s S/../.././02</B>
</PRE>

To schedule a long Self-Test between 4-5am every Sunday morning, use:
<PRE>
<B> -s L/../../7/04</B>
</PRE>

To schedule a long Self-Test between 10-11pm on the first and
fifteenth day of each month, use:
<PRE>
<B> -s L/../(01|15)/./22</B>
</PRE>

To schedule an Offline Immediate test after every midnight, 6am,
noon,and 6pm, plus a Short Self-Test daily at 1-2am and a Long
Self-Test every Saturday at 3-4am, use:
<PRE>
<B> -s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)</B>
</PRE>

If Long Self-Tests of a large disks take longer than the system uptime,
a full disk test can be performed by several Selective Self-Tests.
To setup a full test of a 1TB disk within 20 days (one 50GB span
each day), run this command once:
<PRE>
  smartctl -t select,0-99999999 /dev/sda
</PRE>

To run the next test spans on Monday-Friday between 12-13am, run smartd
with this directive:
<PRE>
<B> -s n/../../[1-5]/12</B>
</PRE>

<P>
<P>
Scheduled tests are run immediately following the regularly-scheduled
device polling, if the current local date, time, and test type, match
<B>REGEXP</B>.  By default the regularly-scheduled device polling
occurs every thirty minutes after starting <B>smartd</B>.  Take caution
if you use the '-i' option to make this polling interval more than
sixty minutes: the poll times may fail to coincide with any of the
testing times that you have specified with <B>REGEXP</B>.  In this case
the test will be run following the next device polling.
<P>
Before running an offline or self-test, <B>smartd</B> checks to be sure
that a self-test is not already running.  If a self-test <B>is</B>
already running, then this running self test will <B>not</B> be
interrupted to begin another test.
<P>
<B>smartd</B> will not attempt to run <B>any</B> type of test if another
test was already started or run in the same hour.
<P>
To avoid performance problems during system boot, <B>smartd</B> will
not attempt to run any scheduled tests following the very first
device polling (unless '-q onecheck' is specified).
<P>
Each time a test is run, <B>smartd</B> will log an entry to SYSLOG.
You can use these or the '-q showtests' command-line option to verify
that you constructed <B>REGEXP</B> correctly.  The matching order
(<B>L</B> before <B>S</B> before <B>C</B> before <B>O</B>) ensures that
if multiple test types are all scheduled for the same hour, the
longer test type has precedence.  This is usually the desired behavior.
<P>
If the scheduled tests are used in conjunction with state persistence
('-s' option), smartd will also try to match the hours since last
shutdown (or 90 days at most). If any test would have been started
during downtime, the longest (see above) of these tests is run after
second device polling.
<P>
If the '-n' directive is used and any test would have been started
during disk standby time, the longest of these tests is run when the
disk is active again.
<P>
Unix users: please beware that the rules for extended regular
expressions [<B>regex</B>(7)] are <B>not</B> the same as the rules for
file-name pattern matching by the shell [<B>glob</B>(7)].  <B>smartd</B> will
issue harmless informational warning messages if it detects characters
in <B>REGEXP</B> that appear to indicate that you have made this
mistake.
<DT><B>-m ADD</B>

<DD>
Send a warning email to the email address <B>ADD</B> if the '-H',
'-l', '-f', '-C', or '-O' Directives detect a failure or a
new error, or if a SMART command to the disk fails. This Directive
only works in conjunction with these other Directives (or with the
equivalent default '-a' Directive).
<P>
To prevent your email in-box from getting filled up with warning
messages, by default only a single warning will be sent for each of
the enabled alert types, '-H', '-l', '-f', '-C', or
'-O' even if more than one failure or error is detected or if the
failure or error persists.  [This behavior can be modified; see the
'-M' Directive below.]
<P>
To send email to more than one user, please use the following &quot;comma
separated&quot; form for the address: <B>user1@add1,user2@add2,...,userN@addN</B>
(with no spaces).
<P>
To test that email is being sent correctly, use the '-M test'
Directive described below to send one test email message on
<B>smartd</B>
startup.
<P>
By default, email is sent using the system <B>mail</B>(1) command.
In order that <B>smartd</B> find this command (normally /usr/bin/mail) the
executable must be in the path of the shell or environment from which
<B>smartd</B>
was started.  If you wish to specify an explicit path to the mail
executable (for example /usr/local/bin/mail) or a custom script to
run, please use the '-M exec' Directive below.
<P>

On Windows, the '<B>Blat</B>' mailer
(<B><A HREF="http://blat.sourceforge.net/">http://blat.sourceforge.net/</A></B>) is used by default.
This mailer uses a different command line syntax, see
'-M exec' below.
<P>

Note also that there is a special argument
<B>&lt;nomailer&gt;</B>

which can be given to the '-m' Directive in conjunction with the '-M
exec' Directive. Please see below for an explanation of its effect.
<P>
If the mailer or the shell running it produces any STDERR/STDOUT
output, then a snippet of that output will be copied to SYSLOG.  The
remainder of the output is discarded. If problems are encountered in
sending mail, this should help you to understand and fix them.  If
you have mail problems, we recommend running <B>smartd</B> in debug
mode with the '-d' flag, using the '-M test' Directive described
below.














<P>
[Windows only] If one of the following words are used as the first address
in the comma separated list, warning messages are sent via WTSSendMessage().
This displays message boxes on the desktops of the selected sessions.
Address '<B>console</B>' specifies the console session only,
'<B>active</B>' specifies the console session and all active remote
sessions, and '<B>connected</B>' specifies the console session and
all connected (active or waiting for login) remote sessions.
This is handled by the script EXEDIR/smartd_warning.cmd which runs
the tool EXEDIR/wtssendmsg.exe (see also '-M exec' below).
The addresses '<B>msgbox</B>' and '<B>sysmsgbox</B>' are now
deprecated and have the same effect as '<B>console</B>'.

<DT><B>-M TYPE</B>

<DD>
These Directives modify the behavior of the
<B>smartd</B>
email warnings enabled with the '-m' email Directive described above.
These '-M' Directives only work in conjunction with the '-m'
Directive and can not be used without it.
<P>
Multiple -M Directives may be given.  If more than one of the
following three -M Directives are given (example: -M once -M daily)
then the final one (in the example, -M daily) is used.
<P>
The valid arguments to the -M Directive are (one of the following
three):
<P>
<I>once</I>

- send only one warning email for each type of disk problem detected.  This
is the default unless state persistence ('-s' option) is enabled.
<P>
<I>daily</I>

- send additional warning reminder emails, once per day, for each type
of disk problem detected.  This is the default if state persistence
('-s' option) is enabled.
<P>
<I>diminishing</I>

- send additional warning reminder emails, after a one-day interval,
then a two-day interval, then a four-day interval, and so on for each
type of disk problem detected. Each interval is twice as long as the
previous interval.
<P>
If a disk problem is no longer detected, the internal email counter is
reset.  If the problem reappears a new warning email is sent immediately.
<P>
In addition, one may add zero or more of the following Directives:
<P>
<I>test</I>

- send a single test email
immediately upon
<B>smartd</B>
startup.  This allows one to verify that email is delivered correctly.
Note that if this Directive is used,
<B>smartd</B>
will also send the normal email warnings that were enabled with the '-m' Directive,
in addition to the single test email!
<P>
<I>exec PATH</I>

- run the executable PATH instead of the default mail command, when
<B>smartd</B>
needs to send email.  PATH must point to an executable binary file or
script.

<P>
[Windows only] The PATH may contain space characters.
Then it must be included in double quotes.

<P>
By setting PATH to point to a customized script, you can make
<B>smartd</B> perform useful tricks when a disk problem is detected
(beeping the console, shutting down the machine, broadcasting warnings
to all logged-in users, etc.)  But please be careful. <B>smartd</B>
will <B>block</B> until the executable PATH returns, so if your
executable hangs, then <B>smartd</B> will also hang.




<P>
The return status of the executable is recorded by <B>smartd</B> in
SYSLOG. The executable is not expected to write to STDOUT or
STDERR.  If it does, then this is interpreted as indicating that
something is going wrong with your executable, and a fragment of this
output is logged to SYSLOG to help you to understand the problem.
Normally, if you wish to leave some record behind, the executable
should send mail or write to a file or device.
<P>
Before running the executable, <B>smartd</B> sets a number of
environment variables.  These environment variables may be used to
control the executable's behavior.  The environment variables
exported by <B>smartd</B> are:
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT><B>SMARTD_MAILER</B><DD>
is set to the argument of -M exec, if present or else to 'mail'
(examples: /usr/local/bin/mail, mail).
<DT><B>SMARTD_DEVICE</B><DD>
is set to the device path (example: /dev/sda).
<DT><B>SMARTD_DEVICETYPE</B><DD>
is set to the device type specified by '-d' directive or
'auto' if none.
<DT><B>SMARTD_DEVICESTRING</B><DD>
is set to the device description.  For SMARTD_DEVICETYPE of ata or
scsi, this is the same as SMARTD_DEVICE.  For 3ware RAID controllers,
the form used is '/dev/sdc [3ware_disk_01]'.  For HighPoint
RocketRAID controller, the form is '/dev/sdd [hpt_1/1/1]' under Linux
or '/dev/hptrr [hpt_1/1/1]' under FreeBSD.  For Areca controllers, the
form is '/dev/sg2 [areca_disk_09]' on Linux or  '/dev/arcmsr0 [areca_disk_09]' on FreeBSD.  In these cases the device string
contains a space and is NOT quoted.  So to use $SMARTD_DEVICESTRING in a
shell script you should probably enclose it in double quotes.
<DT><B>SMARTD_DEVICEINFO</B><DD>
is set to device identify information.  It includes most of the info printed
by <B>smartctl -i</B> but uses a brief single line format.
This device info is also logged when <B>smartd</B> starts up.
The string contains space characters and is NOT quoted.
<DT><B>SMARTD_FAILTYPE</B><DD>
gives the reason for the warning or message email.  The possible values that
it takes and their meanings are:
<BR>

<I>EmailTest</I>: this is an email test message.
<BR>

<I>Health</I>: the SMART health status indicates imminent failure.
<BR>

<I>Usage</I>: a usage Attribute has failed.
<BR>

<I>SelfTest</I>: the number of self-test failures has increased.
<BR>

<I>ErrorCount</I>: the number of errors in the ATA error log has increased.
<BR>

<I>CurrentPendingSector</I>: one of more disk sectors could not be
read and are marked to be reallocated (replaced with spare sectors).
<BR>

<I>OfflineUncorrectableSector</I>: during off-line testing, or self-testing,
one or more disk sectors could not be read.
<BR>

<I>Temperature</I>: Temperature reached critical limit (see -W directive).
<BR>

<I>FailedHealthCheck</I>: the SMART health status command failed.
<BR>

<I>FailedReadSmartData</I>: the command to read SMART Attribute data failed.
<BR>

<I>FailedReadSmartErrorLog</I>: the command to read the SMART error log failed.
<BR>

<I>FailedReadSmartSelfTestLog</I>: the command to read the SMART self-test log failed.
<BR>

<I>FailedOpenDevice</I>: the open() command to the device failed.
<DT><B>SMARTD_ADDRESS</B><DD>
is determined by the address argument ADD of the '-m' Directive.
If ADD is <B>&lt;nomailer&gt;</B>, then <B>SMARTD_ADDRESS</B> is not set.
Otherwise, it is set to the comma-separated-list of email addresses
given by the argument ADD, with the commas replaced by spaces
(example:admin@example.com root).  If more than one email address is
given, then this string will contain space characters and is NOT
quoted, so to use it in a shell script you may want to enclose it in
double quotes.

<DT><B>SMARTD_ADDRCSV</B><DD>
[Windows only] is set to a comma-separated list of the addresses from
SMARTD_ADDRESS.

<DT><B>SMARTD_MESSAGE</B><DD>
is set to the one sentence summary warning email message string from
<B>smartd</B>. 
This message string contains space characters and is NOT quoted. So to
use $SMARTD_MESSAGE in a shell script you should probably enclose it in
double quotes.









<DT><B>SMARTD_FULLMSGFILE</B><DD>
[Windows only] is the path to a temporary file containing the full message.
The path may contain space characters and is NOT quoted.
The file is created by the smartd_warning.cmd script and removed when
the mailer or command exits.

<DT><B>SMARTD_TFIRST</B><DD>
is a text string giving the time and date at which the first problem
of this type was reported. This text string contains space characters
and no newlines, and is NOT quoted. For example:
<BR>

Sun Feb  9 14:58:19 2003 CST
<DT><B>SMARTD_TFIRSTEPOCH</B><DD>
is an integer, which is the unix epoch (number of seconds since Jan 1,
1970) for <B>SMARTD_TFIRST</B>.
<DT><B>SMARTD_PREVCNT</B><DD>
is an integer specifying the number of previous messages sent.
It is set to '0' for the first message.
<DT><B>SMARTD_NEXTDAYS</B><DD>
is an integer specifying the number of days until the next message will be sent.
It it set to empty on '-M once' and set to '1' on '-M daily'.
</DL>
</DL>



<DT><B></B>

<DD>
If the '-m ADD' Directive is given with a normal address argument,
then the executable pointed to by PATH will be run in a shell with
STDIN receiving the body of the email message, and with the same
command-line arguments:
<PRE>
-s &quot;$SMARTD_SUBJECT&quot; $SMARTD_ADDRESS
</PRE>

that would normally be provided to 'mail'.  Examples include:
<PRE>
<B>-m user@home -M exec /usr/bin/mail</B>
<B>-m admin@work -M exec /usr/local/bin/mailto</B>
<B>-m root -M exec /Example_1/shell/script/below</B>
</PRE>

<P>

[Windows only] On Windows, the syntax of the '<B>Blat</B>' mailer is
used:
<PRE>
- -q -subject &quot;%SMARTD_SUBJECT%&quot; -to %SMARTD_ADDRCSV%
</PRE>

<P>

If the '-m ADD' Directive is given with the special address argument
<B>&lt;nomailer&gt;</B>

then the executable pointed to by PATH is run in a shell with
<B>no</B>

STDIN and
<B>no</B>

command-line arguments, for example:
<PRE>
<B>-m &lt;nomailer&gt; -M exec /Example_2/shell/script/below</B>
</PRE>

If the executable produces any STDERR/STDOUT output, then <B>smartd</B>
assumes that something is going wrong, and a snippet of that output
will be copied to SYSLOG.  The remainder of the output is then
discarded.
<P>
Some EXAMPLES of scripts that can be used with the '-M exec'
Directive are given below.




<P>
The executable is run by the script







EXEDIR/smartd_warning.cmd. 
This script formats subject and full message based on SMARTD_MESSAGE and other
environment variables set by <B>smartd</B>.
The environment variables







SMARTD_SUBJECT, SMARTD_FULLMSGFILE and SMARTD_ADDRCSV 
are set by the script before running the executable.
<DT><B>-f</B>

<DD>
[ATA only] Check for 'failure' of any Usage Attributes.  If these
Attributes are less than or equal to the threshold, it does NOT indicate
imminent disk failure.  It &quot;indicates an advisory condition where the usage
or age of the device has exceeded its intended design life period.&quot;
[Please see the <B>smartctl -A</B> command-line option.]
<DT><B>-p</B>

<DD>
[ATA only] Report anytime that a Prefail Attribute has changed
its value since the last check. [Please see the
<B>smartctl -A</B>

command-line option.]
<DT><B>-u</B>

<DD>
[ATA only] Report anytime that a Usage Attribute has changed its value
since the last check. [Please see the
<B>smartctl -A</B>

command-line option.]
<DT><B>-t</B>

<DD>
[ATA only] Equivalent to turning on the two previous flags '-p' and '-u'.
Tracks changes in <I>all</I> device Attributes (both Prefailure and
Usage). [Please see the <B>smartctl</B> -A command-line option.]
<DT><B>-i ID</B>

<DD>
[ATA only] Ignore device Attribute number <B>ID</B> when checking for failure
of Usage Attributes.  <B>ID</B> must be a decimal integer in the range
from 1 to 255.  This Directive modifies the behavior of the '-f'
Directive and has no effect without it.
<P>
This is useful, for example, if you have a very old disk and don't
want to keep getting messages about the hours-on-lifetime Attribute
(usually Attribute 9) failing.  This Directive may appear multiple
times for a single device, if you want to ignore multiple Attributes.
<DT><B>-I ID</B>

<DD>
[ATA only] Ignore device Attribute <B>ID</B> when tracking changes in the
Attribute values.  <B>ID</B> must be a decimal integer in the range
from 1 to 255.  This Directive modifies the behavior of the '-p',
'-u', and '-t' tracking Directives and has no effect without one
of them.
<P>
This is useful, for example, if one of the device Attributes is the disk
temperature (usually Attribute 194 or 231). It's annoying to get reports
each time the temperature changes.  This Directive may appear multiple
times for a single device, if you want to ignore multiple Attributes.
<DT><B>-r ID[!]</B>

<DD>
[ATA only] When tracking, report the <I>Raw</I> value of Attribute <B>ID</B>
along with its (normally reported) <I>Normalized</I> value.  <B>ID</B> must
be a decimal integer in the range from 1 to 255.  This Directive modifies
the behavior of the '-p', '-u', and '-t' tracking Directives
and has no effect without one of them.  This Directive may be given
multiple times.
<P>
A common use of this Directive is to track the device Temperature
(often ID=194 or 231).
<P>
If the optional flag '!' is appended, a change of the Normalized
value is considered critical.  The report will be logged as LOG_CRIT
and a warning email will be sent if '-m' is specified.
<DT><B>-R ID[!]</B>

<DD>
[ATA only] When tracking, report whenever the <I>Raw</I> value of Attribute
<B>ID</B> changes.  (Normally <B>smartd</B> only tracks/reports changes
of the <I>Normalized</I> Attribute values.)  <B>ID</B> must be a decimal
integer in the range from 1 to 255.  This Directive modifies the
behavior of the '-p', '-u', and '-t' tracking Directives and
has no effect without one of them.  This Directive may be given
multiple times.
<P>
If this Directive is given, it automatically implies the '-r'
Directive for the same Attribute, so that the Raw value of the
Attribute is reported.
<P>
A common use of this Directive is to track the device Temperature
(often ID=194 or 231).  It is also useful for understanding how
different types of system behavior affects the values of certain
Attributes.
<P>
If the optional flag '!' is appended, a change of the Raw
value is considered critical.  The report will be logged as
LOG_CRIT and a warning email will be sent if '-m' is specified.
An example is '-R 5!' to warn when new sectors are reallocated.
<DT><B>-C ID[+]</B>

<DD>
[ATA only] Report if the current number of pending sectors is
non-zero.  Here <B>ID</B> is the id number of the Attribute whose raw
value is the Current Pending Sector count.  The allowed range of
<B>ID</B> is 0 to 255 inclusive.  To turn off this reporting, use
ID&nbsp;=&nbsp;0.  If the <B>-C ID</B> option is not given, then it defaults to
<B>-C 197</B> (since Attribute 197 is generally used to monitor
pending sectors).  If the name of this Attribute is changed by a
'-v 197,FORMAT,NAME' directive, the default is changed to
<B>-C 0</B>.
<P>
If '+' is specified, a report is only printed if the number of sectors
has increased between two check cycles. Some disks do not reset this
attribute when a bad sector is reallocated.
See also '-v 197,increasing' below.
<P>
The warning email counter is reset if the number of pending sectors
dropped to 0.  This typically happens when all pending sectors have
been reallocated or could be read again.
<P>
A pending sector is a disk sector (containing 512 bytes of your data)
which the device would like to mark as ``bad&quot; and reallocate.
Typically this is because your computer tried to read that sector, and
the read failed because the data on it has been corrupted and has
inconsistent Error Checking and Correction (ECC) codes.  This is
important to know, because it means that there is some unreadable data
on the disk.  The problem of figuring out what file this data belongs
to is operating system and file system specific.  You can typically
force the sector to reallocate by writing to it (translation: make the
device substitute a spare good sector for the bad one) but at the
price of losing the 512 bytes of data stored there.
<DT><B>-U ID[+]</B>

<DD>
[ATA only] Report if the number of offline uncorrectable sectors is
non-zero.  Here <B>ID</B> is the id number of the Attribute whose raw
value is the Offline Uncorrectable Sector count.  The allowed range of
<B>ID</B> is 0 to 255 inclusive.  To turn off this reporting, use
ID&nbsp;=&nbsp;0.  If the <B>-U ID</B> option is not given, then it defaults to
<B>-U 198</B> (since Attribute 198 is generally used to monitor
offline uncorrectable sectors).  If the name of this Attribute is changed
by a '-v 198,FORMAT,NAME' (except '-v 198,FORMAT,Offline_Scan_UNC_SectCt'),
directive, the default is changed to <B>-U 0</B>.
<P>
If '+' is specified, a report is only printed if the number of sectors
has increased since the last check cycle. Some disks do not reset this
attribute when a bad sector is reallocated.
See also '-v 198,increasing' below.
<P>
The warning email counter is reset if the number of offline uncorrectable
sectors dropped to 0.  This typically happens when all offline uncorrectable
sectors have been reallocated or could be read again.
<P>
An offline uncorrectable sector is a disk sector which was not
readable during an off-line scan or a self-test.  This is important
to know, because if you have data stored in this disk sector, and you
need to read it, the read will fail.  Please see the previous '-C'
option for more details.
<DT><B>-W DIFF[,INFO[,CRIT]]</B>

<DD>
Report if the current temperature had changed by at least <B>DIFF</B>
degrees since last report, or if new min or max temperature is detected.
Report or Warn if the temperature is greater or equal than one of
<B>INFO</B> or <B>CRIT</B> degrees Celsius.
If the limit <B>CRIT</B> is reached, a message with loglevel
<B>'LOG_CRIT'</B> will be logged to syslog and a warning email
will be send if '-m' is specified. If only the limit <B>INFO</B> is
reached, a message with loglevel <B>'LOG_INFO'</B> will be logged.
<P>
The warning email counter is reset if the temperature dropped below
<B>INFO</B> or <B>CRIT</B>-5 if <B>INFO</B> is not specified.
<P>
If this directive is used in conjunction with state persistence
('-s' option), the min and max temperature values are preserved
across boot cycles. The minimum temperature value is not updated
during the first 30 minutes after startup.
<P>
To disable any of the 3 reports, set the corresponding limit to 0.
Trailing zero arguments may be omitted. By default, all temperature
reports are disabled ('-W 0').
<P>
To track temperature changes of at least 2 degrees, use:
<PRE>
<B>-W 2</B>
</PRE>

To log informal messages on temperatures of at least 40 degrees, use:
<PRE>
<B>-W 0,40</B>
</PRE>

For warning messages/mails on temperatures of at least 45 degrees, use:
<PRE>
<B>-W 0,0,45</B>
</PRE>

To combine all of the above reports, use:
<PRE>
<B>-W 2,40,45</B>
</PRE>

<P>
For ATA devices, smartd interprets Attribute 194 or 190 as Temperature Celsius
by default. This can be changed to Attribute 9 or 220 by the drive
database or by the '-v 9,temp' or '-v 220,temp' directive.
<DT><B>-F TYPE</B>

<DD>
[ATA only] Modifies the behavior of <B>smartd</B> to compensate for some
known and understood device firmware bug.  This directive may be used
multiple times.  The valid arguments are:
<P>
<I>none</I>

- Assume that the device firmware obeys the ATA specifications.  This
is the default, unless the device has presets for '-F' in the
drive database.  Using this directive will override any preset values.
<P>
<I>nologdir</I>

- Suppresses read attempts of SMART or GP Log Directory.
Support for all standard logs is assumed without an actual check.
Some Intel SSDs may freeze if log address 0 is read.
<P>
<I>samsung</I>

- In some Samsung disks (example: model SV4012H Firmware Version:
RM100-08) some of the two- and four-byte quantities in the SMART data
structures are byte-swapped (relative to the ATA specification).
Enabling this option tells <B>smartd</B> to evaluate these quantities
in byte-reversed order.  Some signs that your disk needs this option
are (1) no self-test log printed, even though you have run self-tests;
(2) very large numbers of ATA errors reported in the ATA error log;
(3) strange and impossible values for the ATA error log timestamps.
<P>
<I>samsung2</I>

- In some Samsung disks the number of ATA errors reported is byte swapped.
Enabling this option tells <B>smartd</B> to evaluate this quantity in
byte-reversed order.
<P>
<I>samsung3</I>

- Some Samsung disks (at least SP2514N with Firmware VF100-37) report
a self-test still in progress with 0% remaining when the test was already
completed. If this directive is specified, <B>smartd</B> will not skip the
next scheduled self-test (see Directive '-s' above) in this case.
<P>
<I>xerrorlba</I>

- This only affects <B>smartctl</B>.
<P>
[Please see the <B>smartctl -F</B> command-line option.]
<DT><B>-v ID,FORMAT[:BYTEORDER][,NAME]</B>

<DD>
[ATA only] Sets a vendor-specific raw value print FORMAT, an optional
BYTEORDER and an optional NAME for Attribute ID.
This directive may be used multiple times.
Please see <B>smartctl -v</B> command-line option for further details.
<P>
The following arguments affect smartd warning output:
<P>
<I>197,increasing</I>

- Raw Attribute number 197 (Current Pending Sector Count) is not
reset if uncorrectable sectors are reallocated.  This sets '-C 197+'
if no other '-C' directive is specified.
<P>
<I>198,increasing</I>

- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not
reset if uncorrectable sectors are reallocated.  This sets '-U 198+'
if no other '-U' directive is specified.
<DT><B>-P TYPE</B>

<DD>
[ATA only] Specifies whether <B>smartd</B> should use any preset options
that are available for this drive.
The valid arguments to this Directive are:
<P>
<I>use</I>

- use any presets that are available for this drive.  This is the default.
<P>
<I>ignore</I>

- do not use any presets for this drive.
<P>
<I>show</I>

- show the presets listed for this drive in the database.
<P>
<I>showall</I>

- show the presets that are available for all drives and then exit.
<P>
[Please see the
<B>smartctl -P</B>

command-line option.]
<DT><B>-a</B>

<DD>
Equivalent to turning on all of the following Directives: 
<B>'-H' </B>

to check the SMART health status,
<B>'-f' </B>

to report failures of Usage (rather than Prefail) Attributes,
<B>'-t' </B>

to track changes in both Prefailure and Usage Attributes,
<B>'-l&nbsp;error'</B>

to report increases in the number of ATA errors,
<B>'-l&nbsp;selftest'</B>

to report increases in the number of Self-Test Log errors,
<B>'-l&nbsp;selfteststs'</B>

to report changes of Self-Test execution status,
<B>'-C 197'</B>

to report nonzero values of the current pending sector count, and
<B>'-U 198'</B>

to report nonzero values of the offline pending sector count.
<P>
Note that -a is the default for ATA devices.  If none of these other
Directives is given, then -a is assumed.
<DT><B>#</B>

<DD>
Comment: ignore the remainder of the line.
<DT><B>\</B>

<DD>
Continuation character: if this is the last non-white or non-comment
character on a line, then the following line is a continuation of the current
one.
</DL>
<P>

If you are not sure which Directives to use, I suggest experimenting
for a few minutes with
<B>smartctl</B>

to see what SMART functionality your disk(s) support(s).  If you do
not like voluminous syslog messages, a good choice of
<B>smartd</B>
configuration file Directives might be:
<PRE>
<B>-H -l&nbsp;selftest -l&nbsp;error -f.</B>
</PRE>

If you want more frequent information, use:
<B>-a.</B>

<P>
<DL COMPACT>
<DT><B>ADDITIONAL DETAILS ABOUT DEVICESCAN</B>

<DD>
If a non-comment entry in the configuration file is the text
string <B>DEVICESCAN</B> in capital letters, then <B>smartd</B> will
ignore any remaining lines in the configuration file, and will scan
for devices (see also <B><A HREF="smartd.8.html">smartd</A></B>(8) man page).
<P>
If <B>DEVICESCAN</B> is not followed by any Directives, then smartd
will scan for both ATA and SCSI devices, and will monitor all possible
SMART properties of any devices that are found.
<P>
<B>DEVICESCAN</B> may optionally be followed by any valid Directives,
which will be applied to all devices that are found in the scan.  For
example
<PRE>
<B>DEVICESCAN -m root@example.com</B>
</PRE>

will scan for all devices, and then monitor them.  It will send one
email warning per device for any problems that are found.
<PRE>
<B>DEVICESCAN -d ata -m root@example.com</B>
</PRE>

will do the same, but restricts the scan to ATA devices only.  
<PRE>
<B>DEVICESCAN -H -d ata -m root@example.com</B>
</PRE>

will do the same, but only monitors the SMART health status of the
devices, (rather than the default -a, which monitors all SMART
properties).
<P>
Configuration entries for specific devices may precede the <B>DEVICESCAN</B> entry.
For example
<PRE>
<B>DEFAULT -m root@example.com</B>
<B>/dev/sda -s S/../.././02</B>
<B>/dev/sdc -d ignore</B>
<B>DEVICESCAN -s L/../.././02</B>
</PRE>

will scan for all devices except /dev/sda and /dev/sdc, monitor them, and run a long
test between 2-3am every morning.  Device /dev/sda will also be monitored, but
only a short test will be run.  Device /dev/sdc will be ignored.
Warning emails will be sent for all monitored devices.
<P>
<DT><B>EXAMPLES OF SHELL SCRIPTS FOR '-M exec'</B>

<DD>
These are two examples of shell scripts that can be used with the '-M
exec PATH' Directive described previously.  The paths to these scripts
and similar executables is the PATH argument to the '-M exec PATH'
Directive.
<P>
Example 1: This script is for use with '-m ADDRESS -M exec PATH'.  It appends
the output of
<B>smartctl -a</B>

to the output of the smartd email warning message and sends it to ADDRESS.
<P>
<PRE>
<B>
#! /bin/sh

# Save the email message (STDIN) to a file:
cat &gt; /root/msg

# Append the output of smartctl -a to the message:
/usr/local/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE &gt;&gt; /root/msg
 
# Now email the message to the user at address ADD:
/usr/bin/mail -s &quot;$SMARTD_SUBJECT&quot; $SMARTD_ADDRESS &lt; /root/msg
</B>
</PRE>

<P>
Example 2: This script is for use with '-m &lt;nomailer&gt; -M exec
PATH'. It warns all users about a disk problem, waits 30 seconds, and
then powers down the machine.
<P>
<PRE>
<B>
#! /bin/sh

# Warn all users of a problem
wall &lt;&lt;EOF
Problem detected with disk: $SMARTD_DEVICESTRING
Warning message from smartd is: $SMARTD_MESSAGE
Shutting down machine in 30 seconds...
EOF

# Wait half a minute
sleep 30

# Power down the machine
/sbin/shutdown -hf now
</B>
</PRE>

<P>
Some example scripts are distributed with the smartmontools package,
in /usr/local/share/doc/smartmontools/examplescripts/.
<P>
Please note that these scripts typically run as root, so any files
that they read/write should not be writable by ordinary users or
reside in directories like /tmp that are writable by ordinary users
and may expose your system to symlink attacks.
<P>
As previously described, if the scripts write to STDOUT or STDERR,
this is interpreted as indicating that there was an internal error
within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG.
The remainder is flushed.
<P>







</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>SEE ALSO</H2>

<B><A HREF="smartd.8.html">smartd</A></B>(8), <B><A HREF="smartctl.8.html">smartctl</A></B>(8),
<B>mail</B>(1), <B>regex</B>(7).
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>PACKAGE VERSION</H2>

smartmontools-6.4 2015-06-04 r4109
<BR>

$Id: smartd.conf.5.in 4103 2015-06-01 19:51:18Z chrfranke $
<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT><A HREF="#lbAD">CONFIGURATION FILE DIRECTIVES</A><DD>
<DT><A HREF="#lbAE">SEE ALSO</A><DD>
<DT><A HREF="#lbAF">PACKAGE VERSION</A><DD>
</DL>
<HR>
This document was created by
<A HREF=".">man2html</A>,
using the manual pages.<BR>
Time: 16:35:19 GMT, June 04, 2015
</BODY>
</HTML>
